let Mock=require('mockjs')
import N from './note'

let bill=Mock.mock('/note',()=>{
    return N.note
})

let addbill=Mock.mock('/addnote',(data:any)=>{
    let d=JSON.parse(data.body)
    d.img=N.getimg()
    N.note.push(d) 
})

let delnote=Mock.mock('/delnote',(data:any)=>{
    let id=JSON.parse(data.body).id
    N.note.forEach((item,ind)=>{
       if(item.id==id){
           N.note.splice(ind,1)
       }
    })
})